package expression;

import java.util.HashMap;
import java.util.LinkedList;

public class FnVariable extends Fn implements FnBool, FnNumber, FnString {

	private String name;

	public FnVariable(String name) {
		this.name = name;
	}

	@Override
	protected boolean isAcceptableChild(Fn fn) {
		return false;
	}
	
	@Override
	protected boolean isAcceptableParam(Object o) {
		return false;
	}

	@Override
	public int getNParam() {
		return 0;
	}

	@Override
	protected int precedence() {
		return Integer.MAX_VALUE;
	}

	@Override
	protected Object value(LinkedList<Object> param) {
		return null;
	}

	public Object value(HashMap<String, Object> value) {
		return value.get(name);
	}

	@Override
	public String symbol() {
		return null;
	}

	@Override
	protected String[] notation() {
		return new String[]
		{ name + "", "", "" };
	}
}
